//
//  HandleNetProduct+Transaction.m
//  LuCaiZhu
//
//  Created by stella Ma on 2018/12/20.
//
#import "NetworkConfig.h"
#import "SVProgressHUD.h"
#import "NSDictionary+NN.h"
#import "AFNetworking.h"
#import "TKAlertCenter.h"
#import "HandleNetProduct+Transaction.h"

@implementation HandleNetProduct (Transaction)

#pragma mark - 追加认购列表
+ (void)getAddRenGouListWithCustomerId:(int)customerId searchName:(NSString *)searchName Success:(void(^)(NSArray *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"AccountAddBooking",
                           @"AccountId":@(customerId),
                           @"ProductName":searchName};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"追加认购列表： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            
            if ([data[@"data"] isKindOfClass:[NSArray class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
    
}

#pragma mark - 认购订单列表
+ (void)getRenGouOrderListWithCustomerId:(int)customerId searchName:(NSString *)searchName Success:(void(^)(NSArray *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"AccountBookingList",
                           @"AccountId":@(customerId),
                           @"ProductName":searchName};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"认购订单列表： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSArray class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
    
}

#pragma mark - 认购列表--作废
+ (void)BookingRevokeforBookingID:(NSString *)bookingID Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    
    NSDictionary *params=@{@"AAAMethodName":@"BookingRevoke",
                           @"BookingId":bookingID};
    NSLog(@"认购列表--作废params： %@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        
        NSLog(@"认购列表--作废： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            NSArray *dataA = data[@"data"];
            if ([dataA count]>0) {
                NSDictionary *dic = dataA[0];
                if ([dic[@"Message"] isEqualToString:@"撤销成功"]) {
                    success(dic);
                }else{
                    failure(dic[@"Message"]);
                    [[TKAlertCenter defaultCenter]postAlertWithMessage:dic[@"Message"]];
                }
                
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
    
}

#pragma mark - 编辑/追加认购
+ (void)EditOrAddBookingforMethodName:(NSString *)methodName BookingID:(NSString *)bookingID bookingAmount:(NSString *)amount Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    
    NSDictionary *params;
    BOOL isAdd;
    if ([methodName isEqualToString:@"BookingEdit"]) {
        params=@{@"AAAMethodName":methodName,
                 @"Amount":amount,
                 @"BookingId":bookingID};
        isAdd = NO;
    }else{
        params=@{@"AAAMethodName":methodName,
                 @"Amount":amount,
                 @"SBookingId":bookingID};
        isAdd = YES;
    }
    NSLog(@"编辑/追加认购params： %@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        
        NSLog(@"编辑/追加认购： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            NSArray *dataA = data[@"data"];
            if ([dataA count]>0) {
                NSDictionary *dic = dataA[0];//追加成功
                if ([dic[@"Status"] intValue] == 0) {
                    //成功
                    success(dic);
                }else{
                    [[TKAlertCenter defaultCenter]postAlertWithMessage:dic[@"Message"]];
                    failure(dic[@"Message"]);
                }
                
                
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
    
}

#pragma mark - 赎回列表
+ (void)getRansomListWithCustomerId:(int)customerId str:(NSString *)str pageIndex:(NSInteger)index Success:(void(^)(NSArray *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemList",
                           @"CustomerId":@(customerId),
                           @"PageIndex": @(index),
                           @"PageSize": @(20),
                           @"IsPage": @"true",
                           @"ProductName": str?str:@""};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1_RDDDDM parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回列表： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSArray class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回财富顾问
+ (void)getRansomHelpCustomerId:(int)customerId Success:(void(^)(NSArray *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedemmContact",
                           @"CustomerId":@(customerId)};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1_RDDDDM parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回财富顾问： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSArray class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回新建显示
+ (void)getRansomNewContractNo:(NSString *)ContractNo Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemAddDetail",
                           @"ContractNo":ContractNo?ContractNo:@""};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回新建显示： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSDictionary class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回份额检查
+ (void)getRansomShareCheck:(NSDictionary *)param Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemShareChange",
                           @"PartRedeem":param[@"PartRedeem"],
                           @"Redeemshare":param[@"Redeemshare"],
                           @"OpenShare":param[@"OpenShare"],
                           @"ClosedShare":param[@"ClosedShare"],
                           @"ContractNo":param[@"ContractNo"],
                           @"IsProductClose":param[@"IsProductClose"]};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回新建显示： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSDictionary class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            if (![data[@"msg"] isEqualToString:@""]) {
                [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
            }
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回新建
+ (void)addRansomNew:(NSDictionary *)param Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemAdd",
                           @"ReDeemId":@"",
                           @"Redeemshare": param[@"Redeemshare"],
                           @"RedeemFee": param[@"RedeemFee"],
                           @"SYShare": param[@"SYShare"],
                           @"SYAmount": param[@"SYAmount"],
                           @"ProductId": param[@"ProductId"],
                           @"SubProductId": param[@"SubProductId"],
                           @"AccountId": param[@"AccountId"],
                           @"OpenDate": param[@"OpenDate"],
                           @"Currency": param[@"Currency"],
                           @"ReferenceAmount": param[@"ReferenceAmount"],
                           @"FaId": param[@"FaId"],
                           @"ContractNo": param[@"ContractNo"]};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回新建显示： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            success(data[@"data"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回订单列表
+ (void)getRansomOrderListWithCustomerId:(int)customerId str:(NSString *)str pageIndex:(NSInteger)index Success:(void(^)(NSArray *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemOrderList",
                           @"CustomerId":@(customerId),
                           @"PageIndex": @(index),
                           @"PageSize": @(20),
                           @"IsPage": @"true",
                           @"ProductName": str?str:@""};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1_RDDDDM parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回订单列表： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSArray class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回订单详情
+ (void)getRansomOrderDetailWithCustomerId:(int)customerId RansomId:(int)ransomId Success:(void(^)(NSArray *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemOrderDetail",
                           @"CustomerId":@(customerId),
                           @"RedeemId":@(ransomId)};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1_RDDDDM parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回订单详情： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSArray class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回订单明细
+ (void)getRansomOrderDetailInfoWithRansomId:(int)ransomId Success:(void(^)(NSArray *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemOrderTable",
                           @"RedeemId":@(ransomId)};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1_RDDDDM parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回订单明细： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSArray class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回订单明细底部数据
+ (void)getRansomBottomInfoWithRansomId:(int)ransomId Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemOrderTotal",
                           @"RedeemId":@(ransomId)};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1_RDDDDM parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回订单明细底部数据： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSDictionary class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回单作废
+ (void)deleteRansomOrderWithCustomerId:(int)customerId RansomId:(int)ransomId Success:(void(^)(NSArray *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemRevoke",
                           @"CustomerId":@(customerId),
                           @"RedeemId":@(ransomId)};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回单作废： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            success(data[@"data"]);
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回单编辑显示
+ (void)getRansomEditRansomId:(NSString *)RansomId Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemEditDetail",
                           @"RedeemId":RansomId};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回编辑显示： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSDictionary class]]) {
                success(data[@"data"][@"Basic"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回编辑份额
+ (void)editRansomShareCheck:(NSDictionary *)param Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemShareChangeEdit",
                           @"PartRedeem":param[@"PartRedeem"],
                           @"Redeemshare":param[@"Redeemshare"],
                           @"OpenShare":param[@"OpenShare"],
                           @"ClosedShare":param[@"ClosedShare"],
                           @"ContractNo":param[@"ContractNo"],
                           @"IsProductClose":param[@"IsProductClose"],
                           @"RedeemId": param[@"RedeemId"]};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回编辑份额： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSDictionary class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            if (![data[@"msg"] isEqualToString:@""]) {
                [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
            }
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回编辑份额保存
+ (void)saveRansomShare:(NSDictionary *)param Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure;
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemEditTitle",
                           @"SubProductId":param[@"SubProductId"],
                           @"ProductId":param[@"ProductId"],
                           @"SYAmount":param[@"SYAmount"],
                           @"SYShare":param[@"SYShare"],
                           @"RedeemFee":param[@"RedeemFee"],
                           @"Redeemshare":param[@"Redeemshare"],
                           @"ReDeemId": param[@"ReDeemId"],
                           @"AccountId": param[@"AccountId"],
                           @"OpenDate": param[@"OpenDate"],
                           @"Currency": param[@"Currency"],
                           @"ReferenceAmount": param[@"ReferenceAmount"],
                           @"FaId": param[@"FaId"],
                           @"ContractNo": param[@"ContractNo"]};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回编辑份额保存： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            success(data[@"data"]);
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 投资检视下拉列表
+ (void)getXialaInspectList:(NSDictionary *)param Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"InvestmentInspectionTitle",
                           @"ProductId":param[@"ProductId"],
                           @"CustomerId":param[@"CustomerId"]};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1_RDDDDM parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"投资检视下拉列表： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSDictionary class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 投资检视列表
+ (void)getInspectList:(NSDictionary *)param Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"InvestmentInspectionList",
                           @"SelectId": param[@"SelectId"],
                           @"ProductId":param[@"ProductId"],
                           @"CustomerId":param[@"CustomerId"],
                           @"TransactionTime": param[@"TransactionTime"],
                           @"TransactionType": param[@"TransactionType"],
                           @"IsPage": @"true",
                           @"PageIndex": param[@"PageIndex"],
                           @"PageSize": @(20)};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1_RDDDDM parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"投资检视列表： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSArray class]]) {
                NSArray *list = data[@"data"];
                if (list.count > 0) {
                    success(list.firstObject);
                }
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回详情信息
+ (void)ransomDetailInfoRansomID:(NSString *)ransomId isDq:(NSString *)isDq Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"InvestmentDetailV",
                           @"RedeemLineId": ransomId,
                           @"IsDsq": isDq};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1_RDDDDM parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回详情信息： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSArray class]]) {
                NSArray *list = data[@"data"];
                if (list.count > 0) {
                    success(list.firstObject);
                }
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 认购详情信息
+ (void)renGouDetailInfoRansomID:(NSString *)ransomId Success:(void(^)(NSDictionary *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"InvestOrderDetail",
                           @"BookingId": ransomId};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1_RDDDDM parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"认购详情信息： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSDictionary class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 订单交易记录
+ (void)getOrderPayListWithBookingId:(NSString *)BookingId ContractNo:(NSString *)ContractNo Success:(void(^)(NSArray *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"InvestOrderRecord",
                           @"BookingId": BookingId?BookingId:@"",
                           @"ContractNo": ContractNo?ContractNo:@""};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1_RDDDDM parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"订单交易记录： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSArray class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 赎回编辑新建跳页数据
+ (void)getJumpDataList:(NSDictionary *)param Success:(void(^)(NSArray *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"RedeemBookingShow",
                           @"ContractNo":param[@"ContractNo"],
                           @"Share":param[@"Share"]};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"赎回编辑新建跳页数据： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSArray class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

#pragma mark - 灰色追加弹框
+ (void)huiAlertRequest:(NSString *)BookingId Success:(void(^)(NSArray *data))success Failure:(void(^)(NSString *errorInfo))failure
{
    [HandleNetProduct show];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer    = [AFHTTPResponseSerializer serializer];
    manager.requestSerializer.timeoutInterval = HTTP_REQUEST_TIMEOUT;
    NSDictionary *params=@{@"AAAMethodName":@"AddBookingMessage",
                           @"BookingId":BookingId};
    NSLog(@"params===%@",params);
    [manager POST:API_HOST1 parameters:params progress:^(NSProgress * _Nonnull uploadProgress) {
        
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary *data = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        [SVProgressHUD dismiss];
        NSLog(@"灰色追加弹框： %@",[NSDictionary logDic:data]);
        if ([data[@"state"] intValue] == 0 ) {
            if ([data[@"data"] isKindOfClass:[NSArray class]]) {
                success(data[@"data"]);
            }else{
                failure(HTTP_REQUEST_FAILURE);
                [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
            }
            
        }else{
            failure(data[@"msg"]);
//            [[TKAlertCenter defaultCenter]postAlertWithMessage:data[@"msg"]];
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(HTTP_REQUEST_FAILURE);
        [SVProgressHUD dismiss];
        [[TKAlertCenter defaultCenter]postAlertWithMessage:HTTP_REQUEST_FAILURE];
        
    }];
}

@end
